using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using DTO;
using DAO;

namespace BUS
{
    public class LoaiPhongBUS
    {
        public LoaiPhongDTO[] TimKiemLoaiPhong(int ID, string MaLP, string TenLP, Double DonGia, string MoTa)
        {
            LoaiPhongDTO[] Arr = new LoaiPhongDTO[100];
            try
            {
                LoaiPhongDAO lpDAO = new LoaiPhongDAO();
                Arr = lpDAO.TimKiemLoaiPhong(ID, MaLP, TenLP, DonGia, MoTa);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return Arr;
        }

        public int ThemLoaiPhong(int ID, string MaLP, string TenLP, long DonGia, string MoTa)
        {
            int kq = 0;
            try
            {
                LoaiPhongDAO lpDAO = new LoaiPhongDAO();
                kq = lpDAO.ThemLoaiPhong(ID, MaLP, TenLP, DonGia, MoTa);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return kq;
        }

        public void CapNhatLoaiPhong(int ID, string MaLP, string TenLP, long DonGia, string MoTa)
        {
            try
            {
                LoaiPhongDAO lpDAO = new LoaiPhongDAO();
                lpDAO.CapNhatLoaiPhong(ID, MaLP, TenLP, DonGia, MoTa);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }

        public LoaiPhongDTO[] LayDanhSachLoaiPhong()
        {
            LoaiPhongDTO[] Arr = new LoaiPhongDTO[100];
            try
            {
                LoaiPhongDAO lpDAO = new LoaiPhongDAO();
                Arr = lpDAO.LayDanhSachLoaiPhong();
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return Arr;
        }

        public LoaiPhongDTO LayLoaiPhongTheoMaPhong(int MaPhong)
        {
            LoaiPhongDTO lpDTO = new LoaiPhongDTO();
            try
            {
                LoaiPhongDAO lpDAO = new LoaiPhongDAO();
                lpDTO = lpDAO.LayLoaiPhongTheoMaPhong(MaPhong);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return lpDTO;
        }
    }
}
